API Documentation
ImageBase.h
1 // ImageBase.h
3 //
5 
6 namespace nkImages
7 {
18  class ImageBase
19  {
20  public :
21 
25  ImageBase () ;
37  ImageBase (unsigned int width, unsigned int height, unsigned int depth, PIXEL_FORMAT format, unsigned int pixelOrBlockByteSize = 0, unsigned int rowByteSize = 0, unsigned int sliceByteSize = 0) ;
50  ImageBase (unsigned int width, unsigned int height, unsigned int depth, unsigned int arraySize, unsigned int mips, PIXEL_FORMAT format, unsigned int pixelOrBlockByteSize = 0) ;
60  ImageBase (nkMemory::BufferCast<ImageDescriptor>&& images, PIXEL_FORMAT format, unsigned int pixelOrBlockByteSize, bool alphaPremultiplied = false, bool cubeMap = false) ;
66  ImageBase (const ImageBase& other) ;
72  ImageBase (ImageBase&& other) ;
76  virtual ~ImageBase () ;
77 
78  // Getters
83  unsigned int getWidth (unsigned int mip = 0) const ;
88  unsigned int getHeight (unsigned int mip = 0) const ;
95  unsigned int getDepthOrArraySize (unsigned int mip = 0) const ;
99  unsigned int getMipCount () const ;
107  unsigned int getPixelByteSize () const ;
112  unsigned int getRowByteSize (unsigned int mip = 0) const ;
117  unsigned int getSliceByteSize (unsigned int mip = 0) const ;
121  bool getAlphaPremultiplied () const ;
125  bool getCubeMap () const ;
131  bool isArray () const ;
132 
133  // Setters
139  void setFormat (PIXEL_FORMAT value) ;
145  void setPixelOrBlockByteSize (unsigned int value) ;
151  void setAlphaPremultiplied (bool value) ;
157  void setCubeMap (bool value) ;
158 
159  // Utils
172  nkMaths::Vector getPixel (unsigned int x, unsigned int y, unsigned int z = 0, unsigned int mip = 0) ;
181  Image decompress (const AlignmentDescriptor& alignmentDescriptor = AlignmentDescriptor()) ;
182 
183  // Data accessors
189  virtual unsigned char* getDataPtr () const = 0 ;
190 
191  // Operators
197  ImageBase& operator= (const ImageBase& other) ;
204  } ;
205 }
nkImages::ImageBase::getMipCount
unsigned int getMipCount() const
nkImages::ImageBase::getCubeMap
bool getCubeMap() const
nkImages::ImageBase::setCubeMap
void setCubeMap(bool value)
nkImages::ImageBase::ImageBase
ImageBase(nkMemory::BufferCast< ImageDescriptor > &&images, PIXEL_FORMAT format, unsigned int pixelOrBlockByteSize, bool alphaPremultiplied=false, bool cubeMap=false)
nkImages::ImageBase::ImageBase
ImageBase(ImageBase &&other)
nkImages::ImageBase::setAlphaPremultiplied
void setAlphaPremultiplied(bool value)
nkImages::ImageBase::getHeight
unsigned int getHeight(unsigned int mip=0) const
nkImages::ImageBase::operator=
ImageBase & operator=(const ImageBase &other)
nkImages::ImageBase::getDataPtr
virtual unsigned char * getDataPtr() const =0
nkImages::ImageBase::ImageBase
ImageBase()
nkImages::ImageBase::decompress
Image decompress(const AlignmentDescriptor &alignmentDescriptor=AlignmentDescriptor())
nkImages::ImageBase::getPixelByteSize
unsigned int getPixelByteSize() const
nkImages::ImageBase
Base for all image data classes.
Definition: ImageBase.h:19
nkImages::ImageBase::setFormat
void setFormat(PIXEL_FORMAT value)
nkImages::AlignmentDescriptor
Holds information about alignment constraints.
Definition: AlignmentDescriptor.h:12
nkImages
Encompasses all API of component NilkinsImages.
Definition: BmpEncoder.h:7
nkImages::ImageBase::setPixelOrBlockByteSize
void setPixelOrBlockByteSize(unsigned int value)
nkImages::ImageBase::getRowByteSize
unsigned int getRowByteSize(unsigned int mip=0) const
nkImages::ImageBase::isArray
bool isArray() const
nkImages::ImageBase::ImageBase
ImageBase(const ImageBase &other)
nkImages::PIXEL_FORMAT
PIXEL_FORMAT
Lists formats for pixels.
Definition: PixelFormat.h:16
nkMemory::BufferCast
Holds a Buffer and make it easy to cast the binary data.
Definition: BufferCast.h:18
nkImages::ImageBase::getFormat
PIXEL_FORMAT getFormat() const
nkImages::ImageBase::getSliceByteSize
unsigned int getSliceByteSize(unsigned int mip=0) const
nkImages::ImageBase::ImageBase
ImageBase(unsigned int width, unsigned int height, unsigned int depth, PIXEL_FORMAT format, unsigned int pixelOrBlockByteSize=0, unsigned int rowByteSize=0, unsigned int sliceByteSize=0)
nkImages::ImageBase::getDepthOrArraySize
unsigned int getDepthOrArraySize(unsigned int mip=0) const
nkImages::ImageBase::getAlphaPremultiplied
bool getAlphaPremultiplied() const
nkMaths::Vector
A 4-component vector class, with floats.
Definition: Vector.h:12
nkImages::ImageBase::ImageBase
ImageBase(unsigned int width, unsigned int height, unsigned int depth, unsigned int arraySize, unsigned int mips, PIXEL_FORMAT format, unsigned int pixelOrBlockByteSize=0)
nkImages::Image
Holds all information required for an image, with ownership over the data.
Definition: Image.h:14
nkImages::ImageBase::getPixel
nkMaths::Vector getPixel(unsigned int x, unsigned int y, unsigned int z=0, unsigned int mip=0)
nkImages::ImageBase::~ImageBase
virtual ~ImageBase()
nkImages::ImageBase::getWidth
unsigned int getWidth(unsigned int mip=0) const